package com.gress.shop.vo;


import com.gress.shop.constants.PopConstants;

/**
 * Created by xiongwen on 2017/12/6.
 */
public class SwalFactory {

    private static SwalReturn swal;

    private SwalFactory() {
    }

    public static final SwalReturn getWarnSwal(){
        swal = new SwalReturn();
        swal.setType(PopConstants.WARNING);
        swal.setTitle(PopConstants.OP_WARNING);
        return swal;
    }

    public static final SwalReturn getSuccessSwal(){
        swal = new SwalReturn();
        swal.setType(PopConstants.SUCCESS);
        swal.setTitle(PopConstants.OP_SUCCESS);
        return swal;
    }

    public static final SwalReturn getErrorSwal(){
        swal = new SwalReturn();
        swal.setType(PopConstants.ERROR);
        swal.setTitle(PopConstants.OP_ERROR);
        return swal;
    }

    public static final SwalReturn getWarnSwal(String text){
        swal = new SwalReturn();
        swal.setType(PopConstants.WARNING);
        swal.setTitle(PopConstants.OP_WARNING);
        swal.setText(text);
        return swal;
    }

    public static final SwalReturn getSuccessSwal(String text){
        swal = new SwalReturn();
        swal.setType(PopConstants.SUCCESS);
        swal.setTitle(PopConstants.OP_SUCCESS);
        swal.setText(text);
        return swal;
    }

    public static final SwalReturn getErrorSwal(String text){
        swal = new SwalReturn();
        swal.setType(PopConstants.ERROR);
        swal.setTitle(PopConstants.OP_ERROR);
        swal.setText(text);
        return swal;
    }
}
